feat: refresh balance allowance cache after order approvals settle - #5
Conversation
DEV-32 Investigate wallet and signer ownership validation in authenticateWith
Investigate whether the Unified TypeScript SDK can verify wallet and signer ownership mismatches during the This work should cover:
Context: Outcome target: |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b4f0997. Configure here.
After an on-chain approval transaction confirms, trigger a server-side cache refresh so the next order placement sees up-to-date allowances. Refreshes COLLATERAL for buy orders and CONDITIONAL (with tokenId) for sell orders. No-ops entirely when existing allowance is already sufficient. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
b4f0997 to
2096d00
Compare

Summary
updateBalanceAllowance()frommain(0281f46) into this branch so the action is availableensureOrderApproval()inprepare.ts— called afterhandle.wait()confirms the approval transaction settledCOLLATERALfor buy orders;CONDITIONAL(withtokenId) for sell ordersTest plan
pnpm typecheckpnpm lint🤖 Generated with Claude Code
Note
Medium Risk
Touches the order-approval workflow and post-transaction behavior; a wrong asset type/tokenId mapping or extra network call could cause stale allowance handling or minor latency during order preparation.
Overview
Ensures allowance state is refreshed immediately after an order approval transaction settles by calling
updateBalanceAllowance()afterhandle.wait()inensureOrderApproval().The refresh targets collateral for buy-side approvals and conditional tokens (including
tokenId) for sell-side approvals, without changing the early-return path when allowance is already sufficient.Reviewed by Cursor Bugbot for commit 2096d00. Bugbot is set up for automated code reviews on this repo. Configure here.